package com.yangke.springcloud.controller;

import com.yangke.springcloud.entites.CommonResult;
import com.yangke.springcloud.entites.Payment;
import com.yangke.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderController {
    // 注入service接口
    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> get(@PathVariable("id") Long id){
        // 调用接口的方法
        return paymentFeignService.getPaymentById(id);
    }

}
